<nz-spin *ngIf="isLoading" class="modal-spin"></nz-spin>
<pic-viewer [picList]="picList" [picIdx]="0" [show]="isShowPic" (onClose)="onPicClose($event)"></pic-viewer>
<div *ngIf="!isLoading && viewType == 1">
  <h2><i class="anticon anticon-exception"></i>  订单信息 <span style="float: right;" *ngIf="entity.paymentMethod == 4">支付宝单号：{{entity.voucher}}</span> <span style="float: right;cursor: pointer;" *ngIf="entity.paymentMethod == 3" (click)="showPic(entity.voucher)" title="点击查看凭证图">银行卡转账凭证：点击查看凭证图</span></h2>
  <desc-list>
    <desc-list-item term="订单号">{{ entity.orderNo }}</desc-list-item>
    <desc-list-item term="物流">{{entity.logistics}}</desc-list-item>
    <desc-list-item term="快递单号">{{entity.expressNo}}</desc-list-item>
    <desc-list-item term="状态">
      <span *ngIf="entity.paymentMethod == 1">
        {{entity.status|dicsNamePipe:cakeOrderStatusOption}}
      </span>
      <span *ngIf="entity.paymentMethod == 2">
        {{entity.serviceStatus|dicsNamePipe:cakeOrderServiceStatusOption}}
      </span>
      <span *ngIf="entity.paymentMethod == 3 ||entity.paymentMethod == 4">
        {{entity.voucherStatus|dicsNamePipe:cakeOrderVoucherStatusOption}}
      </span>
    </desc-list-item>
    <desc-list-item term="客户姓名">{{entity.postalName}}</desc-list-item>
    <desc-list-item term="客户手机">{{entity.postalPhone}}</desc-list-item>
    <desc-list-item term="最终单价(￥)">{{entity.goodsUnitPrice+entity.markupPrice}}</desc-list-item>
    <desc-list-item term="产品(数量)">
        {{entity.activityProducts.title}}({{entity.goodsQuantity}}{{entity.activityProducts.unit}})
    </desc-list-item>
    <desc-list-item term="订单总价(￥)">{{entity.goodsTotalPrice}}</desc-list-item>
    <!--<desc-list-item term="寄件地址">{{entity.postalAddress}}</desc-list-item>-->
    <!--<desc-list-item term="客服联系情况">{{entity.remark?entity.remark:"暂未联系"}}</desc-list-item>-->
  </desc-list>
  <p style="margin-top: 16px;" *ngIf="entity.remark">客户备注：{{entity.remark}}</p>
  <p style="margin-top: 16px;" *ngIf="entity.paymentMethod != 2 && entity.postalAddress">寄件地址：{{entity.postalAddress}}</p>
  <p style="margin-top: 16px;" *ngIf="entity.paymentMethod == 2">客服联系情况：{{entity.remark?entity.remark:"暂未联系"}}</p>
  <span *ngIf="entity.companyId">
    <h2><i class="anticon anticon-exception"></i>  收益记录</h2>
    <nz-table #profitTable [nzData]="profitRecordInfos" [nzShowPagination]="false">
      <thead>
      <tr>
        <th  style="max-width: 460px;">微信昵称</th>
        <th>手机号</th>
        <th>收益比率</th>
        <th>收益金额</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let data of profitTable.data">
        <td style="max-width: 460px;">{{data.cusName}}</td>
        <td>{{data.cusPhone}}</td>
        <td>{{data.ratio}}</td>
        <td>{{data.profit}}</td>
      </tr>
      </tbody>
    </nz-table>
    <h2><i class="anticon anticon-exception"></i>  现金奖励记录</h2>
    <nz-table #basicTable [nzData]="redpackRewards" [nzShowPagination]="false">
      <thead>
      <tr>
        <th  style="max-width: 460px;">微信昵称</th>
        <th>手机号</th>
        <th>比率</th>
        <th>金额</th>
        <th>是否发放成功</th>
        <th>备注</th>
        <th>操作</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let data of basicTable.data">
        <td style="max-width: 460px;" [title]="data.cusName">{{data.cusName|stringEllipsisCutPipe:8}}</td>
        <td>{{data.cusPhone}}</td>
        <td>{{data.ratio}}</td>
        <td>{{(data.amount/100).toFixed(2)}}</td>
        <td style="max-width: 200px;">{{data.payStatus|yesNoPipe}}<span *ngIf="data.payStatus == 2 && data.amount != '0'" [title]="data.errCodeDes">({{data.errCodeDes?(data.errCodeDes|stringEllipsisCutPipe:16):"未发放"}})</span></td>
        <td style="max-width: 180px;" [title]="data.remark">{{data.remark|stringEllipsisCutPipe:10}}</td>
        <td>
          <nz-popconfirm [nzTitle]="'确定重新发放现金奖励吗？'" (nzOnConfirm)="reSend(data)">
          <a nz-popconfirm *ngIf="data.payStatus == 2 && data.amount != '0'">补发</a>
        </nz-popconfirm>
        </td>
      </tr>
      </tbody>
    </nz-table>
    <h2><i class="anticon anticon-exception"></i>  积分奖励记录</h2>
    <nz-table #basicTable1 [nzData]="integralRewards" [nzShowPagination]="false">
      <thead>
      <tr>
        <th  style="max-width: 460px;">微信昵称</th>
        <th>手机号</th>
        <th>比率</th>
        <th>积分</th>
        <th>备注</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let data of basicTable1.data">
        <td style="max-width: 460px;">{{data.cusName}}</td>
        <td>{{data.cusPhone}}</td>
        <td>{{data.ratio}}</td>
        <td>{{data.amount}}</td>
        <td>{{data.remark}}</td>
      </tr>
      </tbody>
    </nz-table>
    <h2><i class="anticon anticon-exception"></i>  业绩记录</h2>
    <nz-table #achievementTable [nzData]="achievementRecordInfos" [nzShowPagination]="false">
      <thead>
      <tr>
        <th  style="max-width: 460px;">微信昵称</th>
        <th>手机号</th>
        <th>获得业绩</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let data of achievementTable.data">
        <td style="max-width: 460px;">{{data.cusName}}</td>
        <td>{{data.cusPhone}}</td>
        <td>{{data.goodsTotalPrice}}</td>
      </tr>
      </tbody>
    </nz-table>
  </span>
</div>
<div *ngIf="!isLoading && viewType == 2">
  <desc-list>
    <desc-list-item term="订单号">{{ entity.orderNo }}</desc-list-item>
    <desc-list-item term="物流">{{entity.logistics}}</desc-list-item>
    <desc-list-item term="快递单号">{{entity.expressNo}}</desc-list-item>
    <desc-list-item term="产品(数量)">{{entity.productId|dicsNamePipe:allProducts:"id":"title"}}({{entity.goodsQuantity}}{{entity.productId|dicsNamePipe:allProducts:"id":"unit"}})</desc-list-item>
    <desc-list-item term="状态">{{entity.status|dicsNamePipe:statusOption}}</desc-list-item>
    <desc-list-item term="发货时间">{{entity.planPostalTime}}</desc-list-item>
    <desc-list-item term="收件人姓名">{{entity.postalName}}</desc-list-item>
    <desc-list-item term="收件人手机">{{entity.postalPhone}}</desc-list-item>
    <desc-list-item term="收件邮编">{{entity.postalCode}}</desc-list-item>
  </desc-list>
  <p style="margin-top: 16px;">寄件地址：{{entity.postalAddress}}</p>
</div>
<div class="modal-footer">
  <button nz-button type="button" (click)="close()">关闭</button>
</div>
